// $ANTLR 3.4 src/epigraph.g 2011-10-03 19:42:19

package epg;

import java.io.*;
import org.antlr.runtime.*;


import org.antlr.runtime.*;
import java.util.Stack;
import java.util.List;
import java.util.ArrayList;

import org.antlr.runtime.tree.*;


@SuppressWarnings({"all", "warnings", "unchecked"})
public class epigraphParser extends Parser {
    public static final String[] tokenNames = new String[] {
        "<invalid>", "<EOR>", "<DOWN>", "<UP>", "ASSIGN", "BEGIN", "BYTE_NAME", "CHAR", "COLON", "COMMA", "COMMENT", "CONST", "DIGIT", "DOT", "DOUBLE_NAME", "ELSE", "END", "EQUAL", "ESC_SEQ", "EXPONENT", "EXPRESSION", "FLOAT", "FLOAT_NAME", "GE", "GT", "HEX_DIGIT", "IDENTIFIER", "IF", "INT", "INTEGER_NAME", "LE", "LPAREN", "LT", "MINUS", "MOD", "MODULE", "NOT_EQUAL", "OCTAL_ESC", "PLUS", "RPAREN", "SEMI", "SLASH", "STAR", "STATEMENT", "STRING", "UNICODE_ESC", "WS"
    };

    public static final int EOF=-1;
    public static final int ASSIGN=4;
    public static final int BEGIN=5;
    public static final int BYTE_NAME=6;
    public static final int CHAR=7;
    public static final int COLON=8;
    public static final int COMMA=9;
    public static final int COMMENT=10;
    public static final int CONST=11;
    public static final int DIGIT=12;
    public static final int DOT=13;
    public static final int DOUBLE_NAME=14;
    public static final int ELSE=15;
    public static final int END=16;
    public static final int EQUAL=17;
    public static final int ESC_SEQ=18;
    public static final int EXPONENT=19;
    public static final int EXPRESSION=20;
    public static final int FLOAT=21;
    public static final int FLOAT_NAME=22;
    public static final int GE=23;
    public static final int GT=24;
    public static final int HEX_DIGIT=25;
    public static final int IDENTIFIER=26;
    public static final int IF=27;
    public static final int INT=28;
    public static final int INTEGER_NAME=29;
    public static final int LE=30;
    public static final int LPAREN=31;
    public static final int LT=32;
    public static final int MINUS=33;
    public static final int MOD=34;
    public static final int MODULE=35;
    public static final int NOT_EQUAL=36;
    public static final int OCTAL_ESC=37;
    public static final int PLUS=38;
    public static final int RPAREN=39;
    public static final int SEMI=40;
    public static final int SLASH=41;
    public static final int STAR=42;
    public static final int STATEMENT=43;
    public static final int STRING=44;
    public static final int UNICODE_ESC=45;
    public static final int WS=46;

    // delegates
    public Parser[] getDelegates() {
        return new Parser[] {};
    }

    // delegators


    public epigraphParser(TokenStream input) {
        this(input, new RecognizerSharedState());
    }
    public epigraphParser(TokenStream input, RecognizerSharedState state) {
        super(input, state);
    }

protected TreeAdaptor adaptor = new CommonTreeAdaptor();

public void setTreeAdaptor(TreeAdaptor adaptor) {
    this.adaptor = adaptor;
}
public TreeAdaptor getTreeAdaptor() {
    return adaptor;
}
    public String[] getTokenNames() { return epigraphParser.tokenNames; }
    public String getGrammarFileName() { return "src/epigraph.g"; }


    // main
    /*
    public static Gen code = null;
    public static String module_name = new String();

    public static void main(String[] args) {
    	try {
    		if (args.length == 1) {
    			System.err.println("Parsing...");
    			epigraphLexer lex = new epigraphLexer(new ANTLRFileStream(args[0]));
    			code = new Gen(args[0]);
    			CommonTokenStream tokens = new CommonTokenStream(lex);
    			epigraphParser g = new epigraphParser(tokens);
    			g.mainRule();
    		} else
    			System.err.println("Usage: java epigraphParser <file name>");

    	} catch (Exception e) {
    		System.err.println("exception: " + e);
    		e.printStackTrace(System.err); // so we can get stack trace
    	}
    	code.close();
    }
    */


    public static class prog_return extends ParserRuleReturnScope {
        CommonTree tree;
        public Object getTree() { return tree; }
    };


    // $ANTLR start "prog"
    // src/epigraph.g:54:1: prog : mainRule ;
    public final epigraphParser.prog_return prog() throws RecognitionException {
        epigraphParser.prog_return retval = new epigraphParser.prog_return();
        retval.start = input.LT(1);


        CommonTree root_0 = null;

        epigraphParser.mainRule_return mainRule1 =null;



        try {
            // src/epigraph.g:54:5: ( mainRule )
            // src/epigraph.g:55:5: mainRule
            {
            root_0 = (CommonTree)adaptor.nil();


            pushFollow(FOLLOW_mainRule_in_prog74);
            mainRule1=mainRule();

            state._fsp--;

            adaptor.addChild(root_0, mainRule1.getTree());

            }

            retval.stop = input.LT(-1);


            retval.tree = (CommonTree)adaptor.rulePostProcessing(root_0);
            adaptor.setTokenBoundaries(retval.tree, retval.start, retval.stop);

        }
        catch (RecognitionException re) {
            reportError(re);
            recover(input,re);
    	retval.tree = (CommonTree)adaptor.errorNode(input, retval.start, input.LT(-1), re);

        }

        finally {
        	// do for sure before leaving
        }
        return retval;
    }
    // $ANTLR end "prog"


    public static class mainRule_return extends ParserRuleReturnScope {
        CommonTree tree;
        public Object getTree() { return tree; }
    };


    // $ANTLR start "mainRule"
    // src/epigraph.g:58:1: mainRule : module ( declConst | declVar )* main_block ;
    public final epigraphParser.mainRule_return mainRule() throws RecognitionException {
        epigraphParser.mainRule_return retval = new epigraphParser.mainRule_return();
        retval.start = input.LT(1);


        CommonTree root_0 = null;

        epigraphParser.module_return module2 =null;

        epigraphParser.declConst_return declConst3 =null;

        epigraphParser.declVar_return declVar4 =null;

        epigraphParser.main_block_return main_block5 =null;



        try {
            // src/epigraph.g:58:9: ( module ( declConst | declVar )* main_block )
            // src/epigraph.g:59:3: module ( declConst | declVar )* main_block
            {
            root_0 = (CommonTree)adaptor.nil();


            pushFollow(FOLLOW_module_in_mainRule85);
            module2=module();

            state._fsp--;

            adaptor.addChild(root_0, module2.getTree());

            // src/epigraph.g:60:3: ( declConst | declVar )*
            loop1:
            do {
                int alt1=3;
                int LA1_0 = input.LA(1);

                if ( (LA1_0==CONST) ) {
                    alt1=1;
                }
                else if ( (LA1_0==BYTE_NAME||LA1_0==DOUBLE_NAME||LA1_0==FLOAT_NAME||LA1_0==INTEGER_NAME) ) {
                    alt1=2;
                }


                switch (alt1) {
            	case 1 :
            	    // src/epigraph.g:60:4: declConst
            	    {
            	    pushFollow(FOLLOW_declConst_in_mainRule90);
            	    declConst3=declConst();

            	    state._fsp--;

            	    adaptor.addChild(root_0, declConst3.getTree());

            	    }
            	    break;
            	case 2 :
            	    // src/epigraph.g:60:16: declVar
            	    {
            	    pushFollow(FOLLOW_declVar_in_mainRule94);
            	    declVar4=declVar();

            	    state._fsp--;

            	    adaptor.addChild(root_0, declVar4.getTree());

            	    }
            	    break;

            	default :
            	    break loop1;
                }
            } while (true);


            pushFollow(FOLLOW_main_block_in_mainRule100);
            main_block5=main_block();

            state._fsp--;

            adaptor.addChild(root_0, main_block5.getTree());

            }

            retval.stop = input.LT(-1);


            retval.tree = (CommonTree)adaptor.rulePostProcessing(root_0);
            adaptor.setTokenBoundaries(retval.tree, retval.start, retval.stop);

        }
        catch (RecognitionException re) {
            reportError(re);
            recover(input,re);
    	retval.tree = (CommonTree)adaptor.errorNode(input, retval.start, input.LT(-1), re);

        }

        finally {
        	// do for sure before leaving
        }
        return retval;
    }
    // $ANTLR end "mainRule"


    public static class main_block_return extends ParserRuleReturnScope {
        CommonTree tree;
        public Object getTree() { return tree; }
    };


    // $ANTLR start "main_block"
    // src/epigraph.g:65:1: main_block : block DOT !;
    public final epigraphParser.main_block_return main_block() throws RecognitionException {
        epigraphParser.main_block_return retval = new epigraphParser.main_block_return();
        retval.start = input.LT(1);


        CommonTree root_0 = null;

        Token DOT7=null;
        epigraphParser.block_return block6 =null;


        CommonTree DOT7_tree=null;

        try {
            // src/epigraph.g:65:12: ( block DOT !)
            // src/epigraph.g:66:5: block DOT !
            {
            root_0 = (CommonTree)adaptor.nil();


            pushFollow(FOLLOW_block_in_main_block115);
            block6=block();

            state._fsp--;

            adaptor.addChild(root_0, block6.getTree());

            DOT7=(Token)match(input,DOT,FOLLOW_DOT_in_main_block117); 

            }

            retval.stop = input.LT(-1);


            retval.tree = (CommonTree)adaptor.rulePostProcessing(root_0);
            adaptor.setTokenBoundaries(retval.tree, retval.start, retval.stop);

        }
        catch (RecognitionException re) {
            reportError(re);
            recover(input,re);
    	retval.tree = (CommonTree)adaptor.errorNode(input, retval.start, input.LT(-1), re);

        }

        finally {
        	// do for sure before leaving
        }
        return retval;
    }
    // $ANTLR end "main_block"


    public static class block_return extends ParserRuleReturnScope {
        CommonTree tree;
        public Object getTree() { return tree; }
    };


    // $ANTLR start "block"
    // src/epigraph.g:69:1: block : BEGIN ^ ( statement )* END ;
    public final epigraphParser.block_return block() throws RecognitionException {
        epigraphParser.block_return retval = new epigraphParser.block_return();
        retval.start = input.LT(1);


        CommonTree root_0 = null;

        Token BEGIN8=null;
        Token END10=null;
        epigraphParser.statement_return statement9 =null;


        CommonTree BEGIN8_tree=null;
        CommonTree END10_tree=null;

        try {
            // src/epigraph.g:69:6: ( BEGIN ^ ( statement )* END )
            // src/epigraph.g:70:5: BEGIN ^ ( statement )* END
            {
            root_0 = (CommonTree)adaptor.nil();


            BEGIN8=(Token)match(input,BEGIN,FOLLOW_BEGIN_in_block133); 
            BEGIN8_tree = 
            (CommonTree)adaptor.create(BEGIN8)
            ;
            root_0 = (CommonTree)adaptor.becomeRoot(BEGIN8_tree, root_0);


            // src/epigraph.g:70:12: ( statement )*
            loop2:
            do {
                int alt2=2;
                int LA2_0 = input.LA(1);

                if ( (LA2_0==BYTE_NAME||LA2_0==CONST||LA2_0==DOUBLE_NAME||LA2_0==FLOAT_NAME||(LA2_0 >= IDENTIFIER && LA2_0 <= IF)||LA2_0==INTEGER_NAME) ) {
                    alt2=1;
                }


                switch (alt2) {
            	case 1 :
            	    // src/epigraph.g:70:13: statement
            	    {
            	    pushFollow(FOLLOW_statement_in_block137);
            	    statement9=statement();

            	    state._fsp--;

            	    adaptor.addChild(root_0, statement9.getTree());

            	    }
            	    break;

            	default :
            	    break loop2;
                }
            } while (true);


            END10=(Token)match(input,END,FOLLOW_END_in_block141); 
            END10_tree = 
            (CommonTree)adaptor.create(END10)
            ;
            adaptor.addChild(root_0, END10_tree);


            }

            retval.stop = input.LT(-1);


            retval.tree = (CommonTree)adaptor.rulePostProcessing(root_0);
            adaptor.setTokenBoundaries(retval.tree, retval.start, retval.stop);

        }
        catch (RecognitionException re) {
            reportError(re);
            recover(input,re);
    	retval.tree = (CommonTree)adaptor.errorNode(input, retval.start, input.LT(-1), re);

        }

        finally {
        	// do for sure before leaving
        }
        return retval;
    }
    // $ANTLR end "block"


    public static class method_return extends ParserRuleReturnScope {
        CommonTree tree;
        public Object getTree() { return tree; }
    };


    // $ANTLR start "method"
    // src/epigraph.g:73:1: method : identifier ^ LPAREN ! ( argument | identifier ) ( COMMA ! ( argument | identifier ) )* RPAREN ! SEMI !;
    public final epigraphParser.method_return method() throws RecognitionException {
        epigraphParser.method_return retval = new epigraphParser.method_return();
        retval.start = input.LT(1);


        CommonTree root_0 = null;

        Token LPAREN12=null;
        Token COMMA15=null;
        Token RPAREN18=null;
        Token SEMI19=null;
        epigraphParser.identifier_return identifier11 =null;

        epigraphParser.argument_return argument13 =null;

        epigraphParser.identifier_return identifier14 =null;

        epigraphParser.argument_return argument16 =null;

        epigraphParser.identifier_return identifier17 =null;


        CommonTree LPAREN12_tree=null;
        CommonTree COMMA15_tree=null;
        CommonTree RPAREN18_tree=null;
        CommonTree SEMI19_tree=null;

        try {
            // src/epigraph.g:73:7: ( identifier ^ LPAREN ! ( argument | identifier ) ( COMMA ! ( argument | identifier ) )* RPAREN ! SEMI !)
            // src/epigraph.g:74:3: identifier ^ LPAREN ! ( argument | identifier ) ( COMMA ! ( argument | identifier ) )* RPAREN ! SEMI !
            {
            root_0 = (CommonTree)adaptor.nil();


            pushFollow(FOLLOW_identifier_in_method152);
            identifier11=identifier();

            state._fsp--;

            root_0 = (CommonTree)adaptor.becomeRoot(identifier11.getTree(), root_0);

            LPAREN12=(Token)match(input,LPAREN,FOLLOW_LPAREN_in_method155); 

            // src/epigraph.g:74:23: ( argument | identifier )
            int alt3=2;
            int LA3_0 = input.LA(1);

            if ( (LA3_0==CHAR||LA3_0==FLOAT||LA3_0==INT||LA3_0==STRING) ) {
                alt3=1;
            }
            else if ( (LA3_0==IDENTIFIER) ) {
                alt3=2;
            }
            else {
                NoViableAltException nvae =
                    new NoViableAltException("", 3, 0, input);

                throw nvae;

            }
            switch (alt3) {
                case 1 :
                    // src/epigraph.g:74:24: argument
                    {
                    pushFollow(FOLLOW_argument_in_method159);
                    argument13=argument();

                    state._fsp--;

                    adaptor.addChild(root_0, argument13.getTree());

                    }
                    break;
                case 2 :
                    // src/epigraph.g:74:35: identifier
                    {
                    pushFollow(FOLLOW_identifier_in_method163);
                    identifier14=identifier();

                    state._fsp--;

                    adaptor.addChild(root_0, identifier14.getTree());

                    }
                    break;

            }


            // src/epigraph.g:74:47: ( COMMA ! ( argument | identifier ) )*
            loop5:
            do {
                int alt5=2;
                int LA5_0 = input.LA(1);

                if ( (LA5_0==COMMA) ) {
                    alt5=1;
                }


                switch (alt5) {
            	case 1 :
            	    // src/epigraph.g:74:48: COMMA ! ( argument | identifier )
            	    {
            	    COMMA15=(Token)match(input,COMMA,FOLLOW_COMMA_in_method167); 

            	    // src/epigraph.g:74:55: ( argument | identifier )
            	    int alt4=2;
            	    int LA4_0 = input.LA(1);

            	    if ( (LA4_0==CHAR||LA4_0==FLOAT||LA4_0==INT||LA4_0==STRING) ) {
            	        alt4=1;
            	    }
            	    else if ( (LA4_0==IDENTIFIER) ) {
            	        alt4=2;
            	    }
            	    else {
            	        NoViableAltException nvae =
            	            new NoViableAltException("", 4, 0, input);

            	        throw nvae;

            	    }
            	    switch (alt4) {
            	        case 1 :
            	            // src/epigraph.g:74:56: argument
            	            {
            	            pushFollow(FOLLOW_argument_in_method171);
            	            argument16=argument();

            	            state._fsp--;

            	            adaptor.addChild(root_0, argument16.getTree());

            	            }
            	            break;
            	        case 2 :
            	            // src/epigraph.g:74:67: identifier
            	            {
            	            pushFollow(FOLLOW_identifier_in_method175);
            	            identifier17=identifier();

            	            state._fsp--;

            	            adaptor.addChild(root_0, identifier17.getTree());

            	            }
            	            break;

            	    }


            	    }
            	    break;

            	default :
            	    break loop5;
                }
            } while (true);


            RPAREN18=(Token)match(input,RPAREN,FOLLOW_RPAREN_in_method181); 

            SEMI19=(Token)match(input,SEMI,FOLLOW_SEMI_in_method184); 

            }

            retval.stop = input.LT(-1);


            retval.tree = (CommonTree)adaptor.rulePostProcessing(root_0);
            adaptor.setTokenBoundaries(retval.tree, retval.start, retval.stop);

        }
        catch (RecognitionException re) {
            reportError(re);
            recover(input,re);
    	retval.tree = (CommonTree)adaptor.errorNode(input, retval.start, input.LT(-1), re);

        }

        finally {
        	// do for sure before leaving
        }
        return retval;
    }
    // $ANTLR end "method"


    public static class argument_return extends ParserRuleReturnScope {
        CommonTree tree;
        public Object getTree() { return tree; }
    };


    // $ANTLR start "argument"
    // src/epigraph.g:77:1: argument : value ;
    public final epigraphParser.argument_return argument() throws RecognitionException {
        epigraphParser.argument_return retval = new epigraphParser.argument_return();
        retval.start = input.LT(1);


        CommonTree root_0 = null;

        epigraphParser.value_return value20 =null;



        try {
            // src/epigraph.g:77:9: ( value )
            // src/epigraph.g:79:3: value
            {
            root_0 = (CommonTree)adaptor.nil();


            pushFollow(FOLLOW_value_in_argument198);
            value20=value();

            state._fsp--;

            adaptor.addChild(root_0, value20.getTree());

            }

            retval.stop = input.LT(-1);


            retval.tree = (CommonTree)adaptor.rulePostProcessing(root_0);
            adaptor.setTokenBoundaries(retval.tree, retval.start, retval.stop);

        }
        catch (RecognitionException re) {
            reportError(re);
            recover(input,re);
    	retval.tree = (CommonTree)adaptor.errorNode(input, retval.start, input.LT(-1), re);

        }

        finally {
        	// do for sure before leaving
        }
        return retval;
    }
    // $ANTLR end "argument"


    public static class statement_return extends ParserRuleReturnScope {
        CommonTree tree;
        public Object getTree() { return tree; }
    };


    // $ANTLR start "statement"
    // src/epigraph.g:83:1: statement : ( simple_statement | ifStatement | declConst | declVar | method );
    public final epigraphParser.statement_return statement() throws RecognitionException {
        epigraphParser.statement_return retval = new epigraphParser.statement_return();
        retval.start = input.LT(1);


        CommonTree root_0 = null;

        epigraphParser.simple_statement_return simple_statement21 =null;

        epigraphParser.ifStatement_return ifStatement22 =null;

        epigraphParser.declConst_return declConst23 =null;

        epigraphParser.declVar_return declVar24 =null;

        epigraphParser.method_return method25 =null;



        try {
            // src/epigraph.g:83:10: ( simple_statement | ifStatement | declConst | declVar | method )
            int alt6=5;
            switch ( input.LA(1) ) {
            case IDENTIFIER:
                {
                int LA6_1 = input.LA(2);

                if ( (LA6_1==ASSIGN) ) {
                    alt6=1;
                }
                else if ( (LA6_1==LPAREN) ) {
                    alt6=5;
                }
                else {
                    NoViableAltException nvae =
                        new NoViableAltException("", 6, 1, input);

                    throw nvae;

                }
                }
                break;
            case IF:
                {
                alt6=2;
                }
                break;
            case CONST:
                {
                alt6=3;
                }
                break;
            case BYTE_NAME:
            case DOUBLE_NAME:
            case FLOAT_NAME:
            case INTEGER_NAME:
                {
                alt6=4;
                }
                break;
            default:
                NoViableAltException nvae =
                    new NoViableAltException("", 6, 0, input);

                throw nvae;

            }

            switch (alt6) {
                case 1 :
                    // src/epigraph.g:84:3: simple_statement
                    {
                    root_0 = (CommonTree)adaptor.nil();


                    pushFollow(FOLLOW_simple_statement_in_statement209);
                    simple_statement21=simple_statement();

                    state._fsp--;

                    adaptor.addChild(root_0, simple_statement21.getTree());

                    }
                    break;
                case 2 :
                    // src/epigraph.g:85:5: ifStatement
                    {
                    root_0 = (CommonTree)adaptor.nil();


                    pushFollow(FOLLOW_ifStatement_in_statement215);
                    ifStatement22=ifStatement();

                    state._fsp--;

                    adaptor.addChild(root_0, ifStatement22.getTree());

                    }
                    break;
                case 3 :
                    // src/epigraph.g:86:5: declConst
                    {
                    root_0 = (CommonTree)adaptor.nil();


                    pushFollow(FOLLOW_declConst_in_statement221);
                    declConst23=declConst();

                    state._fsp--;

                    adaptor.addChild(root_0, declConst23.getTree());

                    }
                    break;
                case 4 :
                    // src/epigraph.g:86:17: declVar
                    {
                    root_0 = (CommonTree)adaptor.nil();


                    pushFollow(FOLLOW_declVar_in_statement225);
                    declVar24=declVar();

                    state._fsp--;

                    adaptor.addChild(root_0, declVar24.getTree());

                    }
                    break;
                case 5 :
                    // src/epigraph.g:86:27: method
                    {
                    root_0 = (CommonTree)adaptor.nil();


                    pushFollow(FOLLOW_method_in_statement229);
                    method25=method();

                    state._fsp--;

                    adaptor.addChild(root_0, method25.getTree());

                    }
                    break;

            }
            retval.stop = input.LT(-1);


            retval.tree = (CommonTree)adaptor.rulePostProcessing(root_0);
            adaptor.setTokenBoundaries(retval.tree, retval.start, retval.stop);

        }
        catch (RecognitionException re) {
            reportError(re);
            recover(input,re);
    	retval.tree = (CommonTree)adaptor.errorNode(input, retval.start, input.LT(-1), re);

        }

        finally {
        	// do for sure before leaving
        }
        return retval;
    }
    // $ANTLR end "statement"


    public static class simple_statement_return extends ParserRuleReturnScope {
        CommonTree tree;
        public Object getTree() { return tree; }
    };


    // $ANTLR start "simple_statement"
    // src/epigraph.g:89:1: simple_statement : assignmentStatement SEMI !;
    public final epigraphParser.simple_statement_return simple_statement() throws RecognitionException {
        epigraphParser.simple_statement_return retval = new epigraphParser.simple_statement_return();
        retval.start = input.LT(1);


        CommonTree root_0 = null;

        Token SEMI27=null;
        epigraphParser.assignmentStatement_return assignmentStatement26 =null;


        CommonTree SEMI27_tree=null;

        try {
            // src/epigraph.g:89:17: ( assignmentStatement SEMI !)
            // src/epigraph.g:90:3: assignmentStatement SEMI !
            {
            root_0 = (CommonTree)adaptor.nil();


            pushFollow(FOLLOW_assignmentStatement_in_simple_statement239);
            assignmentStatement26=assignmentStatement();

            state._fsp--;

            adaptor.addChild(root_0, assignmentStatement26.getTree());

            SEMI27=(Token)match(input,SEMI,FOLLOW_SEMI_in_simple_statement241); 

            }

            retval.stop = input.LT(-1);


            retval.tree = (CommonTree)adaptor.rulePostProcessing(root_0);
            adaptor.setTokenBoundaries(retval.tree, retval.start, retval.stop);

        }
        catch (RecognitionException re) {
            reportError(re);
            recover(input,re);
    	retval.tree = (CommonTree)adaptor.errorNode(input, retval.start, input.LT(-1), re);

        }

        finally {
        	// do for sure before leaving
        }
        return retval;
    }
    // $ANTLR end "simple_statement"


    public static class assignmentStatement_return extends ParserRuleReturnScope {
        CommonTree tree;
        public Object getTree() { return tree; }
    };


    // $ANTLR start "assignmentStatement"
    // src/epigraph.g:93:1: assignmentStatement : variable ASSIGN ^ expression ;
    public final epigraphParser.assignmentStatement_return assignmentStatement() throws RecognitionException {
        epigraphParser.assignmentStatement_return retval = new epigraphParser.assignmentStatement_return();
        retval.start = input.LT(1);


        CommonTree root_0 = null;

        Token ASSIGN29=null;
        epigraphParser.variable_return variable28 =null;

        epigraphParser.expression_return expression30 =null;


        CommonTree ASSIGN29_tree=null;

        try {
            // src/epigraph.g:93:20: ( variable ASSIGN ^ expression )
            // src/epigraph.g:94:3: variable ASSIGN ^ expression
            {
            root_0 = (CommonTree)adaptor.nil();


            pushFollow(FOLLOW_variable_in_assignmentStatement252);
            variable28=variable();

            state._fsp--;

            adaptor.addChild(root_0, variable28.getTree());

            ASSIGN29=(Token)match(input,ASSIGN,FOLLOW_ASSIGN_in_assignmentStatement254); 
            ASSIGN29_tree = 
            (CommonTree)adaptor.create(ASSIGN29)
            ;
            root_0 = (CommonTree)adaptor.becomeRoot(ASSIGN29_tree, root_0);


            pushFollow(FOLLOW_expression_in_assignmentStatement257);
            expression30=expression();

            state._fsp--;

            adaptor.addChild(root_0, expression30.getTree());

            }

            retval.stop = input.LT(-1);


            retval.tree = (CommonTree)adaptor.rulePostProcessing(root_0);
            adaptor.setTokenBoundaries(retval.tree, retval.start, retval.stop);

        }
        catch (RecognitionException re) {
            reportError(re);
            recover(input,re);
    	retval.tree = (CommonTree)adaptor.errorNode(input, retval.start, input.LT(-1), re);

        }

        finally {
        	// do for sure before leaving
        }
        return retval;
    }
    // $ANTLR end "assignmentStatement"


    public static class variable_return extends ParserRuleReturnScope {
        CommonTree tree;
        public Object getTree() { return tree; }
    };


    // $ANTLR start "variable"
    // src/epigraph.g:97:1: variable : identifier ;
    public final epigraphParser.variable_return variable() throws RecognitionException {
        epigraphParser.variable_return retval = new epigraphParser.variable_return();
        retval.start = input.LT(1);


        CommonTree root_0 = null;

        epigraphParser.identifier_return identifier31 =null;



        try {
            // src/epigraph.g:97:9: ( identifier )
            // src/epigraph.g:98:3: identifier
            {
            root_0 = (CommonTree)adaptor.nil();


            pushFollow(FOLLOW_identifier_in_variable267);
            identifier31=identifier();

            state._fsp--;

            adaptor.addChild(root_0, identifier31.getTree());

            }

            retval.stop = input.LT(-1);


            retval.tree = (CommonTree)adaptor.rulePostProcessing(root_0);
            adaptor.setTokenBoundaries(retval.tree, retval.start, retval.stop);

        }
        catch (RecognitionException re) {
            reportError(re);
            recover(input,re);
    	retval.tree = (CommonTree)adaptor.errorNode(input, retval.start, input.LT(-1), re);

        }

        finally {
        	// do for sure before leaving
        }
        return retval;
    }
    // $ANTLR end "variable"


    public static class expression_return extends ParserRuleReturnScope {
        CommonTree tree;
        public Object getTree() { return tree; }
    };


    // $ANTLR start "expression"
    // src/epigraph.g:101:1: expression : simpleExpression ( ( EQUAL !| NOT_EQUAL !| LT !| LE !| GE !| GT !) simpleExpression )* ;
    public final epigraphParser.expression_return expression() throws RecognitionException {
        epigraphParser.expression_return retval = new epigraphParser.expression_return();
        retval.start = input.LT(1);


        CommonTree root_0 = null;

        Token EQUAL33=null;
        Token NOT_EQUAL34=null;
        Token LT35=null;
        Token LE36=null;
        Token GE37=null;
        Token GT38=null;
        epigraphParser.simpleExpression_return simpleExpression32 =null;

        epigraphParser.simpleExpression_return simpleExpression39 =null;


        CommonTree EQUAL33_tree=null;
        CommonTree NOT_EQUAL34_tree=null;
        CommonTree LT35_tree=null;
        CommonTree LE36_tree=null;
        CommonTree GE37_tree=null;
        CommonTree GT38_tree=null;

        try {
            // src/epigraph.g:102:5: ( simpleExpression ( ( EQUAL !| NOT_EQUAL !| LT !| LE !| GE !| GT !) simpleExpression )* )
            // src/epigraph.g:103:5: simpleExpression ( ( EQUAL !| NOT_EQUAL !| LT !| LE !| GE !| GT !) simpleExpression )*
            {
            root_0 = (CommonTree)adaptor.nil();


            pushFollow(FOLLOW_simpleExpression_in_expression284);
            simpleExpression32=simpleExpression();

            state._fsp--;

            adaptor.addChild(root_0, simpleExpression32.getTree());

            // src/epigraph.g:104:5: ( ( EQUAL !| NOT_EQUAL !| LT !| LE !| GE !| GT !) simpleExpression )*
            loop8:
            do {
                int alt8=2;
                int LA8_0 = input.LA(1);

                if ( (LA8_0==EQUAL||(LA8_0 >= GE && LA8_0 <= GT)||LA8_0==LE||LA8_0==LT||LA8_0==NOT_EQUAL) ) {
                    alt8=1;
                }


                switch (alt8) {
            	case 1 :
            	    // src/epigraph.g:104:7: ( EQUAL !| NOT_EQUAL !| LT !| LE !| GE !| GT !) simpleExpression
            	    {
            	    // src/epigraph.g:104:7: ( EQUAL !| NOT_EQUAL !| LT !| LE !| GE !| GT !)
            	    int alt7=6;
            	    switch ( input.LA(1) ) {
            	    case EQUAL:
            	        {
            	        alt7=1;
            	        }
            	        break;
            	    case NOT_EQUAL:
            	        {
            	        alt7=2;
            	        }
            	        break;
            	    case LT:
            	        {
            	        alt7=3;
            	        }
            	        break;
            	    case LE:
            	        {
            	        alt7=4;
            	        }
            	        break;
            	    case GE:
            	        {
            	        alt7=5;
            	        }
            	        break;
            	    case GT:
            	        {
            	        alt7=6;
            	        }
            	        break;
            	    default:
            	        NoViableAltException nvae =
            	            new NoViableAltException("", 7, 0, input);

            	        throw nvae;

            	    }

            	    switch (alt7) {
            	        case 1 :
            	            // src/epigraph.g:104:8: EQUAL !
            	            {
            	            EQUAL33=(Token)match(input,EQUAL,FOLLOW_EQUAL_in_expression293); 

            	            }
            	            break;
            	        case 2 :
            	            // src/epigraph.g:104:17: NOT_EQUAL !
            	            {
            	            NOT_EQUAL34=(Token)match(input,NOT_EQUAL,FOLLOW_NOT_EQUAL_in_expression298); 

            	            }
            	            break;
            	        case 3 :
            	            // src/epigraph.g:104:30: LT !
            	            {
            	            LT35=(Token)match(input,LT,FOLLOW_LT_in_expression303); 

            	            }
            	            break;
            	        case 4 :
            	            // src/epigraph.g:104:36: LE !
            	            {
            	            LE36=(Token)match(input,LE,FOLLOW_LE_in_expression308); 

            	            }
            	            break;
            	        case 5 :
            	            // src/epigraph.g:104:42: GE !
            	            {
            	            GE37=(Token)match(input,GE,FOLLOW_GE_in_expression313); 

            	            }
            	            break;
            	        case 6 :
            	            // src/epigraph.g:104:48: GT !
            	            {
            	            GT38=(Token)match(input,GT,FOLLOW_GT_in_expression318); 

            	            }
            	            break;

            	    }


            	    pushFollow(FOLLOW_simpleExpression_in_expression323);
            	    simpleExpression39=simpleExpression();

            	    state._fsp--;

            	    adaptor.addChild(root_0, simpleExpression39.getTree());

            	    }
            	    break;

            	default :
            	    break loop8;
                }
            } while (true);


            }

            retval.stop = input.LT(-1);


            retval.tree = (CommonTree)adaptor.rulePostProcessing(root_0);
            adaptor.setTokenBoundaries(retval.tree, retval.start, retval.stop);

        }
        catch (RecognitionException re) {
            reportError(re);
            recover(input,re);
    	retval.tree = (CommonTree)adaptor.errorNode(input, retval.start, input.LT(-1), re);

        }

        finally {
        	// do for sure before leaving
        }
        return retval;
    }
    // $ANTLR end "expression"


    public static class simpleExpression_return extends ParserRuleReturnScope {
        CommonTree tree;
        public Object getTree() { return tree; }
    };


    // $ANTLR start "simpleExpression"
    // src/epigraph.g:107:1: simpleExpression : term ( ( PLUS !| MINUS !) term )* ;
    public final epigraphParser.simpleExpression_return simpleExpression() throws RecognitionException {
        epigraphParser.simpleExpression_return retval = new epigraphParser.simpleExpression_return();
        retval.start = input.LT(1);


        CommonTree root_0 = null;

        Token PLUS41=null;
        Token MINUS42=null;
        epigraphParser.term_return term40 =null;

        epigraphParser.term_return term43 =null;


        CommonTree PLUS41_tree=null;
        CommonTree MINUS42_tree=null;

        try {
            // src/epigraph.g:108:5: ( term ( ( PLUS !| MINUS !) term )* )
            // src/epigraph.g:108:7: term ( ( PLUS !| MINUS !) term )*
            {
            root_0 = (CommonTree)adaptor.nil();


            pushFollow(FOLLOW_term_in_simpleExpression347);
            term40=term();

            state._fsp--;

            adaptor.addChild(root_0, term40.getTree());

            // src/epigraph.g:108:12: ( ( PLUS !| MINUS !) term )*
            loop10:
            do {
                int alt10=2;
                int LA10_0 = input.LA(1);

                if ( (LA10_0==MINUS||LA10_0==PLUS) ) {
                    alt10=1;
                }


                switch (alt10) {
            	case 1 :
            	    // src/epigraph.g:108:14: ( PLUS !| MINUS !) term
            	    {
            	    // src/epigraph.g:108:14: ( PLUS !| MINUS !)
            	    int alt9=2;
            	    int LA9_0 = input.LA(1);

            	    if ( (LA9_0==PLUS) ) {
            	        alt9=1;
            	    }
            	    else if ( (LA9_0==MINUS) ) {
            	        alt9=2;
            	    }
            	    else {
            	        NoViableAltException nvae =
            	            new NoViableAltException("", 9, 0, input);

            	        throw nvae;

            	    }
            	    switch (alt9) {
            	        case 1 :
            	            // src/epigraph.g:108:15: PLUS !
            	            {
            	            PLUS41=(Token)match(input,PLUS,FOLLOW_PLUS_in_simpleExpression352); 

            	            }
            	            break;
            	        case 2 :
            	            // src/epigraph.g:108:23: MINUS !
            	            {
            	            MINUS42=(Token)match(input,MINUS,FOLLOW_MINUS_in_simpleExpression357); 

            	            }
            	            break;

            	    }


            	    pushFollow(FOLLOW_term_in_simpleExpression362);
            	    term43=term();

            	    state._fsp--;

            	    adaptor.addChild(root_0, term43.getTree());

            	    }
            	    break;

            	default :
            	    break loop10;
                }
            } while (true);


            }

            retval.stop = input.LT(-1);


            retval.tree = (CommonTree)adaptor.rulePostProcessing(root_0);
            adaptor.setTokenBoundaries(retval.tree, retval.start, retval.stop);

        }
        catch (RecognitionException re) {
            reportError(re);
            recover(input,re);
    	retval.tree = (CommonTree)adaptor.errorNode(input, retval.start, input.LT(-1), re);

        }

        finally {
        	// do for sure before leaving
        }
        return retval;
    }
    // $ANTLR end "simpleExpression"


    public static class term_return extends ParserRuleReturnScope {
        CommonTree tree;
        public Object getTree() { return tree; }
    };


    // $ANTLR start "term"
    // src/epigraph.g:111:1: term : signedFactor ( ( STAR !| SLASH !| MOD !) signedFactor )* ;
    public final epigraphParser.term_return term() throws RecognitionException {
        epigraphParser.term_return retval = new epigraphParser.term_return();
        retval.start = input.LT(1);


        CommonTree root_0 = null;

        Token STAR45=null;
        Token SLASH46=null;
        Token MOD47=null;
        epigraphParser.signedFactor_return signedFactor44 =null;

        epigraphParser.signedFactor_return signedFactor48 =null;


        CommonTree STAR45_tree=null;
        CommonTree SLASH46_tree=null;
        CommonTree MOD47_tree=null;

        try {
            // src/epigraph.g:112:3: ( signedFactor ( ( STAR !| SLASH !| MOD !) signedFactor )* )
            // src/epigraph.g:112:5: signedFactor ( ( STAR !| SLASH !| MOD !) signedFactor )*
            {
            root_0 = (CommonTree)adaptor.nil();


            pushFollow(FOLLOW_signedFactor_in_term380);
            signedFactor44=signedFactor();

            state._fsp--;

            adaptor.addChild(root_0, signedFactor44.getTree());

            // src/epigraph.g:112:18: ( ( STAR !| SLASH !| MOD !) signedFactor )*
            loop12:
            do {
                int alt12=2;
                int LA12_0 = input.LA(1);

                if ( (LA12_0==MOD||(LA12_0 >= SLASH && LA12_0 <= STAR)) ) {
                    alt12=1;
                }


                switch (alt12) {
            	case 1 :
            	    // src/epigraph.g:112:20: ( STAR !| SLASH !| MOD !) signedFactor
            	    {
            	    // src/epigraph.g:112:20: ( STAR !| SLASH !| MOD !)
            	    int alt11=3;
            	    switch ( input.LA(1) ) {
            	    case STAR:
            	        {
            	        alt11=1;
            	        }
            	        break;
            	    case SLASH:
            	        {
            	        alt11=2;
            	        }
            	        break;
            	    case MOD:
            	        {
            	        alt11=3;
            	        }
            	        break;
            	    default:
            	        NoViableAltException nvae =
            	            new NoViableAltException("", 11, 0, input);

            	        throw nvae;

            	    }

            	    switch (alt11) {
            	        case 1 :
            	            // src/epigraph.g:112:21: STAR !
            	            {
            	            STAR45=(Token)match(input,STAR,FOLLOW_STAR_in_term385); 

            	            }
            	            break;
            	        case 2 :
            	            // src/epigraph.g:112:29: SLASH !
            	            {
            	            SLASH46=(Token)match(input,SLASH,FOLLOW_SLASH_in_term390); 

            	            }
            	            break;
            	        case 3 :
            	            // src/epigraph.g:112:39: MOD !
            	            {
            	            MOD47=(Token)match(input,MOD,FOLLOW_MOD_in_term396); 

            	            }
            	            break;

            	    }


            	    pushFollow(FOLLOW_signedFactor_in_term401);
            	    signedFactor48=signedFactor();

            	    state._fsp--;

            	    adaptor.addChild(root_0, signedFactor48.getTree());

            	    }
            	    break;

            	default :
            	    break loop12;
                }
            } while (true);


            }

            retval.stop = input.LT(-1);


            retval.tree = (CommonTree)adaptor.rulePostProcessing(root_0);
            adaptor.setTokenBoundaries(retval.tree, retval.start, retval.stop);

        }
        catch (RecognitionException re) {
            reportError(re);
            recover(input,re);
    	retval.tree = (CommonTree)adaptor.errorNode(input, retval.start, input.LT(-1), re);

        }

        finally {
        	// do for sure before leaving
        }
        return retval;
    }
    // $ANTLR end "term"


    public static class signedFactor_return extends ParserRuleReturnScope {
        CommonTree tree;
        public Object getTree() { return tree; }
    };


    // $ANTLR start "signedFactor"
    // src/epigraph.g:115:1: signedFactor : ( PLUS !| MINUS !)? factor ;
    public final epigraphParser.signedFactor_return signedFactor() throws RecognitionException {
        epigraphParser.signedFactor_return retval = new epigraphParser.signedFactor_return();
        retval.start = input.LT(1);


        CommonTree root_0 = null;

        Token PLUS49=null;
        Token MINUS50=null;
        epigraphParser.factor_return factor51 =null;


        CommonTree PLUS49_tree=null;
        CommonTree MINUS50_tree=null;

        try {
            // src/epigraph.g:116:5: ( ( PLUS !| MINUS !)? factor )
            // src/epigraph.g:116:7: ( PLUS !| MINUS !)? factor
            {
            root_0 = (CommonTree)adaptor.nil();


            // src/epigraph.g:116:7: ( PLUS !| MINUS !)?
            int alt13=3;
            int LA13_0 = input.LA(1);

            if ( (LA13_0==PLUS) ) {
                alt13=1;
            }
            else if ( (LA13_0==MINUS) ) {
                alt13=2;
            }
            switch (alt13) {
                case 1 :
                    // src/epigraph.g:116:8: PLUS !
                    {
                    PLUS49=(Token)match(input,PLUS,FOLLOW_PLUS_in_signedFactor422); 

                    }
                    break;
                case 2 :
                    // src/epigraph.g:116:14: MINUS !
                    {
                    MINUS50=(Token)match(input,MINUS,FOLLOW_MINUS_in_signedFactor425); 

                    }
                    break;

            }


            pushFollow(FOLLOW_factor_in_signedFactor430);
            factor51=factor();

            state._fsp--;

            adaptor.addChild(root_0, factor51.getTree());

            }

            retval.stop = input.LT(-1);


            retval.tree = (CommonTree)adaptor.rulePostProcessing(root_0);
            adaptor.setTokenBoundaries(retval.tree, retval.start, retval.stop);

        }
        catch (RecognitionException re) {
            reportError(re);
            recover(input,re);
    	retval.tree = (CommonTree)adaptor.errorNode(input, retval.start, input.LT(-1), re);

        }

        finally {
        	// do for sure before leaving
        }
        return retval;
    }
    // $ANTLR end "signedFactor"


    public static class factor_return extends ParserRuleReturnScope {
        CommonTree tree;
        public Object getTree() { return tree; }
    };


    // $ANTLR start "factor"
    // src/epigraph.g:119:1: factor : ( variable | LPAREN ! expression RPAREN !| INT !);
    public final epigraphParser.factor_return factor() throws RecognitionException {
        epigraphParser.factor_return retval = new epigraphParser.factor_return();
        retval.start = input.LT(1);


        CommonTree root_0 = null;

        Token LPAREN53=null;
        Token RPAREN55=null;
        Token INT56=null;
        epigraphParser.variable_return variable52 =null;

        epigraphParser.expression_return expression54 =null;


        CommonTree LPAREN53_tree=null;
        CommonTree RPAREN55_tree=null;
        CommonTree INT56_tree=null;

        try {
            // src/epigraph.g:120:5: ( variable | LPAREN ! expression RPAREN !| INT !)
            int alt14=3;
            switch ( input.LA(1) ) {
            case IDENTIFIER:
                {
                alt14=1;
                }
                break;
            case LPAREN:
                {
                alt14=2;
                }
                break;
            case INT:
                {
                alt14=3;
                }
                break;
            default:
                NoViableAltException nvae =
                    new NoViableAltException("", 14, 0, input);

                throw nvae;

            }

            switch (alt14) {
                case 1 :
                    // src/epigraph.g:120:7: variable
                    {
                    root_0 = (CommonTree)adaptor.nil();


                    pushFollow(FOLLOW_variable_in_factor447);
                    variable52=variable();

                    state._fsp--;

                    adaptor.addChild(root_0, variable52.getTree());

                    }
                    break;
                case 2 :
                    // src/epigraph.g:121:7: LPAREN ! expression RPAREN !
                    {
                    root_0 = (CommonTree)adaptor.nil();


                    LPAREN53=(Token)match(input,LPAREN,FOLLOW_LPAREN_in_factor455); 

                    pushFollow(FOLLOW_expression_in_factor458);
                    expression54=expression();

                    state._fsp--;

                    adaptor.addChild(root_0, expression54.getTree());

                    RPAREN55=(Token)match(input,RPAREN,FOLLOW_RPAREN_in_factor460); 

                    }
                    break;
                case 3 :
                    // src/epigraph.g:122:7: INT !
                    {
                    root_0 = (CommonTree)adaptor.nil();


                    INT56=(Token)match(input,INT,FOLLOW_INT_in_factor469); 

                    }
                    break;

            }
            retval.stop = input.LT(-1);


            retval.tree = (CommonTree)adaptor.rulePostProcessing(root_0);
            adaptor.setTokenBoundaries(retval.tree, retval.start, retval.stop);

        }
        catch (RecognitionException re) {
            reportError(re);
            recover(input,re);
    	retval.tree = (CommonTree)adaptor.errorNode(input, retval.start, input.LT(-1), re);

        }

        finally {
        	// do for sure before leaving
        }
        return retval;
    }
    // $ANTLR end "factor"


    public static class ifStatement_return extends ParserRuleReturnScope {
        CommonTree tree;
        public Object getTree() { return tree; }
    };


    // $ANTLR start "ifStatement"
    // src/epigraph.g:125:1: ifStatement : IF expr ( statement )* END SEMI ( elseStatement )? -> ^( IF expr ^( STATEMENT ( statement )* ) ( elseStatement )? ) ;
    public final epigraphParser.ifStatement_return ifStatement() throws RecognitionException {
        epigraphParser.ifStatement_return retval = new epigraphParser.ifStatement_return();
        retval.start = input.LT(1);


        CommonTree root_0 = null;

        Token IF57=null;
        Token END60=null;
        Token SEMI61=null;
        epigraphParser.expr_return expr58 =null;

        epigraphParser.statement_return statement59 =null;

        epigraphParser.elseStatement_return elseStatement62 =null;


        CommonTree IF57_tree=null;
        CommonTree END60_tree=null;
        CommonTree SEMI61_tree=null;
        RewriteRuleTokenStream stream_END=new RewriteRuleTokenStream(adaptor,"token END");
        RewriteRuleTokenStream stream_SEMI=new RewriteRuleTokenStream(adaptor,"token SEMI");
        RewriteRuleTokenStream stream_IF=new RewriteRuleTokenStream(adaptor,"token IF");
        RewriteRuleSubtreeStream stream_statement=new RewriteRuleSubtreeStream(adaptor,"rule statement");
        RewriteRuleSubtreeStream stream_expr=new RewriteRuleSubtreeStream(adaptor,"rule expr");
        RewriteRuleSubtreeStream stream_elseStatement=new RewriteRuleSubtreeStream(adaptor,"rule elseStatement");
        try {
            // src/epigraph.g:125:12: ( IF expr ( statement )* END SEMI ( elseStatement )? -> ^( IF expr ^( STATEMENT ( statement )* ) ( elseStatement )? ) )
            // src/epigraph.g:132:6: IF expr ( statement )* END SEMI ( elseStatement )?
            {
            IF57=(Token)match(input,IF,FOLLOW_IF_in_ifStatement497);  
            stream_IF.add(IF57);


            pushFollow(FOLLOW_expr_in_ifStatement499);
            expr58=expr();

            state._fsp--;

            stream_expr.add(expr58.getTree());

            // src/epigraph.g:133:5: ( statement )*
            loop15:
            do {
                int alt15=2;
                int LA15_0 = input.LA(1);

                if ( (LA15_0==BYTE_NAME||LA15_0==CONST||LA15_0==DOUBLE_NAME||LA15_0==FLOAT_NAME||(LA15_0 >= IDENTIFIER && LA15_0 <= IF)||LA15_0==INTEGER_NAME) ) {
                    alt15=1;
                }


                switch (alt15) {
            	case 1 :
            	    // src/epigraph.g:133:6: statement
            	    {
            	    pushFollow(FOLLOW_statement_in_ifStatement506);
            	    statement59=statement();

            	    state._fsp--;

            	    stream_statement.add(statement59.getTree());

            	    }
            	    break;

            	default :
            	    break loop15;
                }
            } while (true);


            END60=(Token)match(input,END,FOLLOW_END_in_ifStatement514);  
            stream_END.add(END60);


            SEMI61=(Token)match(input,SEMI,FOLLOW_SEMI_in_ifStatement516);  
            stream_SEMI.add(SEMI61);


            // src/epigraph.g:135:5: ( elseStatement )?
            int alt16=2;
            int LA16_0 = input.LA(1);

            if ( (LA16_0==ELSE) ) {
                alt16=1;
            }
            switch (alt16) {
                case 1 :
                    // src/epigraph.g:136:7: elseStatement
                    {
                    pushFollow(FOLLOW_elseStatement_in_ifStatement530);
                    elseStatement62=elseStatement();

                    state._fsp--;

                    stream_elseStatement.add(elseStatement62.getTree());

                    }
                    break;

            }


            // AST REWRITE
            // elements: IF, statement, elseStatement, expr
            // token labels: 
            // rule labels: retval
            // token list labels: 
            // rule list labels: 
            // wildcard labels: 
            retval.tree = root_0;
            RewriteRuleSubtreeStream stream_retval=new RewriteRuleSubtreeStream(adaptor,"rule retval",retval!=null?retval.tree:null);

            root_0 = (CommonTree)adaptor.nil();
            // 138:5: -> ^( IF expr ^( STATEMENT ( statement )* ) ( elseStatement )? )
            {
                // src/epigraph.g:139:5: ^( IF expr ^( STATEMENT ( statement )* ) ( elseStatement )? )
                {
                CommonTree root_1 = (CommonTree)adaptor.nil();
                root_1 = (CommonTree)adaptor.becomeRoot(
                stream_IF.nextNode()
                , root_1);

                adaptor.addChild(root_1, stream_expr.nextTree());

                // src/epigraph.g:139:15: ^( STATEMENT ( statement )* )
                {
                CommonTree root_2 = (CommonTree)adaptor.nil();
                root_2 = (CommonTree)adaptor.becomeRoot(
                (CommonTree)adaptor.create(STATEMENT, "STATEMENT")
                , root_2);

                // src/epigraph.g:139:27: ( statement )*
                while ( stream_statement.hasNext() ) {
                    adaptor.addChild(root_2, stream_statement.nextTree());

                }
                stream_statement.reset();

                adaptor.addChild(root_1, root_2);
                }

                // src/epigraph.g:139:41: ( elseStatement )?
                if ( stream_elseStatement.hasNext() ) {
                    adaptor.addChild(root_1, stream_elseStatement.nextTree());

                }
                stream_elseStatement.reset();

                adaptor.addChild(root_0, root_1);
                }

            }


            retval.tree = root_0;

            }

            retval.stop = input.LT(-1);


            retval.tree = (CommonTree)adaptor.rulePostProcessing(root_0);
            adaptor.setTokenBoundaries(retval.tree, retval.start, retval.stop);

        }
        catch (RecognitionException re) {
            reportError(re);
            recover(input,re);
    	retval.tree = (CommonTree)adaptor.errorNode(input, retval.start, input.LT(-1), re);

        }

        finally {
        	// do for sure before leaving
        }
        return retval;
    }
    // $ANTLR end "ifStatement"


    public static class noIfStatement_return extends ParserRuleReturnScope {
        CommonTree tree;
        public Object getTree() { return tree; }
    };


    // $ANTLR start "noIfStatement"
    // src/epigraph.g:142:1: noIfStatement : ( simple_statement | declConst | declVar | method );
    public final epigraphParser.noIfStatement_return noIfStatement() throws RecognitionException {
        epigraphParser.noIfStatement_return retval = new epigraphParser.noIfStatement_return();
        retval.start = input.LT(1);


        CommonTree root_0 = null;

        epigraphParser.simple_statement_return simple_statement63 =null;

        epigraphParser.declConst_return declConst64 =null;

        epigraphParser.declVar_return declVar65 =null;

        epigraphParser.method_return method66 =null;



        try {
            // src/epigraph.g:142:14: ( simple_statement | declConst | declVar | method )
            int alt17=4;
            switch ( input.LA(1) ) {
            case IDENTIFIER:
                {
                int LA17_1 = input.LA(2);

                if ( (LA17_1==ASSIGN) ) {
                    alt17=1;
                }
                else if ( (LA17_1==LPAREN) ) {
                    alt17=4;
                }
                else {
                    NoViableAltException nvae =
                        new NoViableAltException("", 17, 1, input);

                    throw nvae;

                }
                }
                break;
            case CONST:
                {
                alt17=2;
                }
                break;
            case BYTE_NAME:
            case DOUBLE_NAME:
            case FLOAT_NAME:
            case INTEGER_NAME:
                {
                alt17=3;
                }
                break;
            default:
                NoViableAltException nvae =
                    new NoViableAltException("", 17, 0, input);

                throw nvae;

            }

            switch (alt17) {
                case 1 :
                    // src/epigraph.g:143:3: simple_statement
                    {
                    root_0 = (CommonTree)adaptor.nil();


                    pushFollow(FOLLOW_simple_statement_in_noIfStatement578);
                    simple_statement63=simple_statement();

                    state._fsp--;

                    adaptor.addChild(root_0, simple_statement63.getTree());

                    }
                    break;
                case 2 :
                    // src/epigraph.g:144:5: declConst
                    {
                    root_0 = (CommonTree)adaptor.nil();


                    pushFollow(FOLLOW_declConst_in_noIfStatement584);
                    declConst64=declConst();

                    state._fsp--;

                    adaptor.addChild(root_0, declConst64.getTree());

                    }
                    break;
                case 3 :
                    // src/epigraph.g:144:17: declVar
                    {
                    root_0 = (CommonTree)adaptor.nil();


                    pushFollow(FOLLOW_declVar_in_noIfStatement588);
                    declVar65=declVar();

                    state._fsp--;

                    adaptor.addChild(root_0, declVar65.getTree());

                    }
                    break;
                case 4 :
                    // src/epigraph.g:144:27: method
                    {
                    root_0 = (CommonTree)adaptor.nil();


                    pushFollow(FOLLOW_method_in_noIfStatement592);
                    method66=method();

                    state._fsp--;

                    adaptor.addChild(root_0, method66.getTree());

                    }
                    break;

            }
            retval.stop = input.LT(-1);


            retval.tree = (CommonTree)adaptor.rulePostProcessing(root_0);
            adaptor.setTokenBoundaries(retval.tree, retval.start, retval.stop);

        }
        catch (RecognitionException re) {
            reportError(re);
            recover(input,re);
    	retval.tree = (CommonTree)adaptor.errorNode(input, retval.start, input.LT(-1), re);

        }

        finally {
        	// do for sure before leaving
        }
        return retval;
    }
    // $ANTLR end "noIfStatement"


    public static class elseStatement_return extends ParserRuleReturnScope {
        CommonTree tree;
        public Object getTree() { return tree; }
    };


    // $ANTLR start "elseStatement"
    // src/epigraph.g:147:1: elseStatement : ELSE ^ ( ifStatement | ( ( noIfStatement )* END ! SEMI !) ) ;
    public final epigraphParser.elseStatement_return elseStatement() throws RecognitionException {
        epigraphParser.elseStatement_return retval = new epigraphParser.elseStatement_return();
        retval.start = input.LT(1);


        CommonTree root_0 = null;

        Token ELSE67=null;
        Token END70=null;
        Token SEMI71=null;
        epigraphParser.ifStatement_return ifStatement68 =null;

        epigraphParser.noIfStatement_return noIfStatement69 =null;


        CommonTree ELSE67_tree=null;
        CommonTree END70_tree=null;
        CommonTree SEMI71_tree=null;

        try {
            // src/epigraph.g:147:14: ( ELSE ^ ( ifStatement | ( ( noIfStatement )* END ! SEMI !) ) )
            // src/epigraph.g:149:3: ELSE ^ ( ifStatement | ( ( noIfStatement )* END ! SEMI !) )
            {
            root_0 = (CommonTree)adaptor.nil();


            ELSE67=(Token)match(input,ELSE,FOLLOW_ELSE_in_elseStatement604); 
            ELSE67_tree = 
            (CommonTree)adaptor.create(ELSE67)
            ;
            root_0 = (CommonTree)adaptor.becomeRoot(ELSE67_tree, root_0);


            // src/epigraph.g:149:9: ( ifStatement | ( ( noIfStatement )* END ! SEMI !) )
            int alt19=2;
            int LA19_0 = input.LA(1);

            if ( (LA19_0==IF) ) {
                alt19=1;
            }
            else if ( (LA19_0==BYTE_NAME||LA19_0==CONST||LA19_0==DOUBLE_NAME||LA19_0==END||LA19_0==FLOAT_NAME||LA19_0==IDENTIFIER||LA19_0==INTEGER_NAME) ) {
                alt19=2;
            }
            else {
                NoViableAltException nvae =
                    new NoViableAltException("", 19, 0, input);

                throw nvae;

            }
            switch (alt19) {
                case 1 :
                    // src/epigraph.g:149:10: ifStatement
                    {
                    pushFollow(FOLLOW_ifStatement_in_elseStatement608);
                    ifStatement68=ifStatement();

                    state._fsp--;

                    adaptor.addChild(root_0, ifStatement68.getTree());

                    }
                    break;
                case 2 :
                    // src/epigraph.g:149:24: ( ( noIfStatement )* END ! SEMI !)
                    {
                    // src/epigraph.g:149:24: ( ( noIfStatement )* END ! SEMI !)
                    // src/epigraph.g:149:26: ( noIfStatement )* END ! SEMI !
                    {
                    // src/epigraph.g:149:26: ( noIfStatement )*
                    loop18:
                    do {
                        int alt18=2;
                        int LA18_0 = input.LA(1);

                        if ( (LA18_0==BYTE_NAME||LA18_0==CONST||LA18_0==DOUBLE_NAME||LA18_0==FLOAT_NAME||LA18_0==IDENTIFIER||LA18_0==INTEGER_NAME) ) {
                            alt18=1;
                        }


                        switch (alt18) {
                    	case 1 :
                    	    // src/epigraph.g:149:27: noIfStatement
                    	    {
                    	    pushFollow(FOLLOW_noIfStatement_in_elseStatement615);
                    	    noIfStatement69=noIfStatement();

                    	    state._fsp--;

                    	    adaptor.addChild(root_0, noIfStatement69.getTree());

                    	    }
                    	    break;

                    	default :
                    	    break loop18;
                        }
                    } while (true);


                    END70=(Token)match(input,END,FOLLOW_END_in_elseStatement619); 

                    SEMI71=(Token)match(input,SEMI,FOLLOW_SEMI_in_elseStatement622); 

                    }


                    }
                    break;

            }


            }

            retval.stop = input.LT(-1);


            retval.tree = (CommonTree)adaptor.rulePostProcessing(root_0);
            adaptor.setTokenBoundaries(retval.tree, retval.start, retval.stop);

        }
        catch (RecognitionException re) {
            reportError(re);
            recover(input,re);
    	retval.tree = (CommonTree)adaptor.errorNode(input, retval.start, input.LT(-1), re);

        }

        finally {
        	// do for sure before leaving
        }
        return retval;
    }
    // $ANTLR end "elseStatement"


    public static class expr_return extends ParserRuleReturnScope {
        CommonTree tree;
        public Object getTree() { return tree; }
    };


    // $ANTLR start "expr"
    // src/epigraph.g:152:1: expr : LPAREN expression RPAREN -> ^( EXPRESSION expression ) ;
    public final epigraphParser.expr_return expr() throws RecognitionException {
        epigraphParser.expr_return retval = new epigraphParser.expr_return();
        retval.start = input.LT(1);


        CommonTree root_0 = null;

        Token LPAREN72=null;
        Token RPAREN74=null;
        epigraphParser.expression_return expression73 =null;


        CommonTree LPAREN72_tree=null;
        CommonTree RPAREN74_tree=null;
        RewriteRuleTokenStream stream_RPAREN=new RewriteRuleTokenStream(adaptor,"token RPAREN");
        RewriteRuleTokenStream stream_LPAREN=new RewriteRuleTokenStream(adaptor,"token LPAREN");
        RewriteRuleSubtreeStream stream_expression=new RewriteRuleSubtreeStream(adaptor,"rule expression");
        try {
            // src/epigraph.g:152:5: ( LPAREN expression RPAREN -> ^( EXPRESSION expression ) )
            // src/epigraph.g:153:3: LPAREN expression RPAREN
            {
            LPAREN72=(Token)match(input,LPAREN,FOLLOW_LPAREN_in_expr637);  
            stream_LPAREN.add(LPAREN72);


            pushFollow(FOLLOW_expression_in_expr639);
            expression73=expression();

            state._fsp--;

            stream_expression.add(expression73.getTree());

            RPAREN74=(Token)match(input,RPAREN,FOLLOW_RPAREN_in_expr641);  
            stream_RPAREN.add(RPAREN74);


            // AST REWRITE
            // elements: expression
            // token labels: 
            // rule labels: retval
            // token list labels: 
            // rule list labels: 
            // wildcard labels: 
            retval.tree = root_0;
            RewriteRuleSubtreeStream stream_retval=new RewriteRuleSubtreeStream(adaptor,"rule retval",retval!=null?retval.tree:null);

            root_0 = (CommonTree)adaptor.nil();
            // 154:3: -> ^( EXPRESSION expression )
            {
                // src/epigraph.g:155:3: ^( EXPRESSION expression )
                {
                CommonTree root_1 = (CommonTree)adaptor.nil();
                root_1 = (CommonTree)adaptor.becomeRoot(
                (CommonTree)adaptor.create(EXPRESSION, "EXPRESSION")
                , root_1);

                adaptor.addChild(root_1, stream_expression.nextTree());

                adaptor.addChild(root_0, root_1);
                }

            }


            retval.tree = root_0;

            }

            retval.stop = input.LT(-1);


            retval.tree = (CommonTree)adaptor.rulePostProcessing(root_0);
            adaptor.setTokenBoundaries(retval.tree, retval.start, retval.stop);

        }
        catch (RecognitionException re) {
            reportError(re);
            recover(input,re);
    	retval.tree = (CommonTree)adaptor.errorNode(input, retval.start, input.LT(-1), re);

        }

        finally {
        	// do for sure before leaving
        }
        return retval;
    }
    // $ANTLR end "expr"


    public static class module_return extends ParserRuleReturnScope {
        CommonTree tree;
        public Object getTree() { return tree; }
    };


    // $ANTLR start "module"
    // src/epigraph.g:158:1: module : MODULE ^ identifier SEMI !;
    public final epigraphParser.module_return module() throws RecognitionException {
        epigraphParser.module_return retval = new epigraphParser.module_return();
        retval.start = input.LT(1);


        CommonTree root_0 = null;

        Token MODULE75=null;
        Token SEMI77=null;
        epigraphParser.identifier_return identifier76 =null;


        CommonTree MODULE75_tree=null;
        CommonTree SEMI77_tree=null;

        try {
            // src/epigraph.g:158:9: ( MODULE ^ identifier SEMI !)
            // src/epigraph.g:159:3: MODULE ^ identifier SEMI !
            {
            root_0 = (CommonTree)adaptor.nil();


            MODULE75=(Token)match(input,MODULE,FOLLOW_MODULE_in_module665); 
            MODULE75_tree = 
            (CommonTree)adaptor.create(MODULE75)
            ;
            root_0 = (CommonTree)adaptor.becomeRoot(MODULE75_tree, root_0);


            pushFollow(FOLLOW_identifier_in_module668);
            identifier76=identifier();

            state._fsp--;

            adaptor.addChild(root_0, identifier76.getTree());

            SEMI77=(Token)match(input,SEMI,FOLLOW_SEMI_in_module670); 

            }

            retval.stop = input.LT(-1);


            retval.tree = (CommonTree)adaptor.rulePostProcessing(root_0);
            adaptor.setTokenBoundaries(retval.tree, retval.start, retval.stop);

        }
        catch (RecognitionException re) {
            reportError(re);
            recover(input,re);
    	retval.tree = (CommonTree)adaptor.errorNode(input, retval.start, input.LT(-1), re);

        }

        finally {
        	// do for sure before leaving
        }
        return retval;
    }
    // $ANTLR end "module"


    public static class string_return extends ParserRuleReturnScope {
        CommonTree tree;
        public Object getTree() { return tree; }
    };


    // $ANTLR start "string"
    // src/epigraph.g:162:1: string : STRING ;
    public final epigraphParser.string_return string() throws RecognitionException {
        epigraphParser.string_return retval = new epigraphParser.string_return();
        retval.start = input.LT(1);


        CommonTree root_0 = null;

        Token STRING78=null;

        CommonTree STRING78_tree=null;

        try {
            // src/epigraph.g:162:9: ( STRING )
            // src/epigraph.g:162:11: STRING
            {
            root_0 = (CommonTree)adaptor.nil();


            STRING78=(Token)match(input,STRING,FOLLOW_STRING_in_string683); 
            STRING78_tree = 
            (CommonTree)adaptor.create(STRING78)
            ;
            adaptor.addChild(root_0, STRING78_tree);


            }

            retval.stop = input.LT(-1);


            retval.tree = (CommonTree)adaptor.rulePostProcessing(root_0);
            adaptor.setTokenBoundaries(retval.tree, retval.start, retval.stop);

        }
        catch (RecognitionException re) {
            reportError(re);
            recover(input,re);
    	retval.tree = (CommonTree)adaptor.errorNode(input, retval.start, input.LT(-1), re);

        }

        finally {
        	// do for sure before leaving
        }
        return retval;
    }
    // $ANTLR end "string"


    public static class declConst_return extends ParserRuleReturnScope {
        CommonTree tree;
        public Object getTree() { return tree; }
    };


    // $ANTLR start "declConst"
    // src/epigraph.g:164:1: declConst : CONST type_token COLON identifier ASSIGN value ( COMMA identifier ASSIGN value )* SEMI -> ^( CONST type_token ( ^( identifier value ) )* ) ;
    public final epigraphParser.declConst_return declConst() throws RecognitionException {
        epigraphParser.declConst_return retval = new epigraphParser.declConst_return();
        retval.start = input.LT(1);


        CommonTree root_0 = null;

        Token CONST79=null;
        Token COLON81=null;
        Token ASSIGN83=null;
        Token COMMA85=null;
        Token ASSIGN87=null;
        Token SEMI89=null;
        epigraphParser.type_token_return type_token80 =null;

        epigraphParser.identifier_return identifier82 =null;

        epigraphParser.value_return value84 =null;

        epigraphParser.identifier_return identifier86 =null;

        epigraphParser.value_return value88 =null;


        CommonTree CONST79_tree=null;
        CommonTree COLON81_tree=null;
        CommonTree ASSIGN83_tree=null;
        CommonTree COMMA85_tree=null;
        CommonTree ASSIGN87_tree=null;
        CommonTree SEMI89_tree=null;
        RewriteRuleTokenStream stream_COLON=new RewriteRuleTokenStream(adaptor,"token COLON");
        RewriteRuleTokenStream stream_COMMA=new RewriteRuleTokenStream(adaptor,"token COMMA");
        RewriteRuleTokenStream stream_SEMI=new RewriteRuleTokenStream(adaptor,"token SEMI");
        RewriteRuleTokenStream stream_CONST=new RewriteRuleTokenStream(adaptor,"token CONST");
        RewriteRuleTokenStream stream_ASSIGN=new RewriteRuleTokenStream(adaptor,"token ASSIGN");
        RewriteRuleSubtreeStream stream_value=new RewriteRuleSubtreeStream(adaptor,"rule value");
        RewriteRuleSubtreeStream stream_identifier=new RewriteRuleSubtreeStream(adaptor,"rule identifier");
        RewriteRuleSubtreeStream stream_type_token=new RewriteRuleSubtreeStream(adaptor,"rule type_token");
        try {
            // src/epigraph.g:165:3: ( CONST type_token COLON identifier ASSIGN value ( COMMA identifier ASSIGN value )* SEMI -> ^( CONST type_token ( ^( identifier value ) )* ) )
            // src/epigraph.g:166:3: CONST type_token COLON identifier ASSIGN value ( COMMA identifier ASSIGN value )* SEMI
            {
            CONST79=(Token)match(input,CONST,FOLLOW_CONST_in_declConst695);  
            stream_CONST.add(CONST79);


            pushFollow(FOLLOW_type_token_in_declConst697);
            type_token80=type_token();

            state._fsp--;

            stream_type_token.add(type_token80.getTree());

            COLON81=(Token)match(input,COLON,FOLLOW_COLON_in_declConst699);  
            stream_COLON.add(COLON81);


            pushFollow(FOLLOW_identifier_in_declConst701);
            identifier82=identifier();

            state._fsp--;

            stream_identifier.add(identifier82.getTree());

            ASSIGN83=(Token)match(input,ASSIGN,FOLLOW_ASSIGN_in_declConst703);  
            stream_ASSIGN.add(ASSIGN83);


            pushFollow(FOLLOW_value_in_declConst705);
            value84=value();

            state._fsp--;

            stream_value.add(value84.getTree());

            // src/epigraph.g:166:50: ( COMMA identifier ASSIGN value )*
            loop20:
            do {
                int alt20=2;
                int LA20_0 = input.LA(1);

                if ( (LA20_0==COMMA) ) {
                    alt20=1;
                }


                switch (alt20) {
            	case 1 :
            	    // src/epigraph.g:166:51: COMMA identifier ASSIGN value
            	    {
            	    COMMA85=(Token)match(input,COMMA,FOLLOW_COMMA_in_declConst708);  
            	    stream_COMMA.add(COMMA85);


            	    pushFollow(FOLLOW_identifier_in_declConst710);
            	    identifier86=identifier();

            	    state._fsp--;

            	    stream_identifier.add(identifier86.getTree());

            	    ASSIGN87=(Token)match(input,ASSIGN,FOLLOW_ASSIGN_in_declConst712);  
            	    stream_ASSIGN.add(ASSIGN87);


            	    pushFollow(FOLLOW_value_in_declConst714);
            	    value88=value();

            	    state._fsp--;

            	    stream_value.add(value88.getTree());

            	    }
            	    break;

            	default :
            	    break loop20;
                }
            } while (true);


            SEMI89=(Token)match(input,SEMI,FOLLOW_SEMI_in_declConst720);  
            stream_SEMI.add(SEMI89);


            // AST REWRITE
            // elements: CONST, identifier, type_token, value
            // token labels: 
            // rule labels: retval
            // token list labels: 
            // rule list labels: 
            // wildcard labels: 
            retval.tree = root_0;
            RewriteRuleSubtreeStream stream_retval=new RewriteRuleSubtreeStream(adaptor,"rule retval",retval!=null?retval.tree:null);

            root_0 = (CommonTree)adaptor.nil();
            // 167:3: -> ^( CONST type_token ( ^( identifier value ) )* )
            {
                // src/epigraph.g:168:3: ^( CONST type_token ( ^( identifier value ) )* )
                {
                CommonTree root_1 = (CommonTree)adaptor.nil();
                root_1 = (CommonTree)adaptor.becomeRoot(
                stream_CONST.nextNode()
                , root_1);

                adaptor.addChild(root_1, stream_type_token.nextTree());

                // src/epigraph.g:168:22: ( ^( identifier value ) )*
                while ( stream_identifier.hasNext()||stream_value.hasNext() ) {
                    // src/epigraph.g:168:22: ^( identifier value )
                    {
                    CommonTree root_2 = (CommonTree)adaptor.nil();
                    root_2 = (CommonTree)adaptor.becomeRoot(stream_identifier.nextNode(), root_2);

                    adaptor.addChild(root_2, stream_value.nextTree());

                    adaptor.addChild(root_1, root_2);
                    }

                }
                stream_identifier.reset();
                stream_value.reset();

                adaptor.addChild(root_0, root_1);
                }

            }


            retval.tree = root_0;

            }

            retval.stop = input.LT(-1);


            retval.tree = (CommonTree)adaptor.rulePostProcessing(root_0);
            adaptor.setTokenBoundaries(retval.tree, retval.start, retval.stop);

        }
        catch (RecognitionException re) {
            reportError(re);
            recover(input,re);
    	retval.tree = (CommonTree)adaptor.errorNode(input, retval.start, input.LT(-1), re);

        }

        finally {
        	// do for sure before leaving
        }
        return retval;
    }
    // $ANTLR end "declConst"


    public static class value_return extends ParserRuleReturnScope {
        CommonTree tree;
        public Object getTree() { return tree; }
    };


    // $ANTLR start "value"
    // src/epigraph.g:173:1: value : ( INT | CHAR | STRING | FLOAT );
    public final epigraphParser.value_return value() throws RecognitionException {
        epigraphParser.value_return retval = new epigraphParser.value_return();
        retval.start = input.LT(1);


        CommonTree root_0 = null;

        Token set90=null;

        CommonTree set90_tree=null;

        try {
            // src/epigraph.g:173:6: ( INT | CHAR | STRING | FLOAT )
            // src/epigraph.g:
            {
            root_0 = (CommonTree)adaptor.nil();


            set90=(Token)input.LT(1);

            if ( input.LA(1)==CHAR||input.LA(1)==FLOAT||input.LA(1)==INT||input.LA(1)==STRING ) {
                input.consume();
                adaptor.addChild(root_0, 
                (CommonTree)adaptor.create(set90)
                );
                state.errorRecovery=false;
            }
            else {
                MismatchedSetException mse = new MismatchedSetException(null,input);
                throw mse;
            }


            }

            retval.stop = input.LT(-1);


            retval.tree = (CommonTree)adaptor.rulePostProcessing(root_0);
            adaptor.setTokenBoundaries(retval.tree, retval.start, retval.stop);

        }
        catch (RecognitionException re) {
            reportError(re);
            recover(input,re);
    	retval.tree = (CommonTree)adaptor.errorNode(input, retval.start, input.LT(-1), re);

        }

        finally {
        	// do for sure before leaving
        }
        return retval;
    }
    // $ANTLR end "value"


    public static class declVar_return extends ParserRuleReturnScope {
        CommonTree tree;
        public Object getTree() { return tree; }
    };


    // $ANTLR start "declVar"
    // src/epigraph.g:175:1: declVar : type_token ^ COLON ! var ( COMMA ! var )* SEMI !;
    public final epigraphParser.declVar_return declVar() throws RecognitionException {
        epigraphParser.declVar_return retval = new epigraphParser.declVar_return();
        retval.start = input.LT(1);


        CommonTree root_0 = null;

        Token COLON92=null;
        Token COMMA94=null;
        Token SEMI96=null;
        epigraphParser.type_token_return type_token91 =null;

        epigraphParser.var_return var93 =null;

        epigraphParser.var_return var95 =null;


        CommonTree COLON92_tree=null;
        CommonTree COMMA94_tree=null;
        CommonTree SEMI96_tree=null;

        try {
            // src/epigraph.g:175:9: ( type_token ^ COLON ! var ( COMMA ! var )* SEMI !)
            // src/epigraph.g:176:4: type_token ^ COLON ! var ( COMMA ! var )* SEMI !
            {
            root_0 = (CommonTree)adaptor.nil();


            pushFollow(FOLLOW_type_token_in_declVar776);
            type_token91=type_token();

            state._fsp--;

            root_0 = (CommonTree)adaptor.becomeRoot(type_token91.getTree(), root_0);

            COLON92=(Token)match(input,COLON,FOLLOW_COLON_in_declVar779); 

            pushFollow(FOLLOW_var_in_declVar782);
            var93=var();

            state._fsp--;

            adaptor.addChild(root_0, var93.getTree());

            // src/epigraph.g:176:27: ( COMMA ! var )*
            loop21:
            do {
                int alt21=2;
                int LA21_0 = input.LA(1);

                if ( (LA21_0==COMMA) ) {
                    alt21=1;
                }


                switch (alt21) {
            	case 1 :
            	    // src/epigraph.g:176:28: COMMA ! var
            	    {
            	    COMMA94=(Token)match(input,COMMA,FOLLOW_COMMA_in_declVar785); 

            	    pushFollow(FOLLOW_var_in_declVar788);
            	    var95=var();

            	    state._fsp--;

            	    adaptor.addChild(root_0, var95.getTree());

            	    }
            	    break;

            	default :
            	    break loop21;
                }
            } while (true);


            SEMI96=(Token)match(input,SEMI,FOLLOW_SEMI_in_declVar792); 

            }

            retval.stop = input.LT(-1);


            retval.tree = (CommonTree)adaptor.rulePostProcessing(root_0);
            adaptor.setTokenBoundaries(retval.tree, retval.start, retval.stop);

        }
        catch (RecognitionException re) {
            reportError(re);
            recover(input,re);
    	retval.tree = (CommonTree)adaptor.errorNode(input, retval.start, input.LT(-1), re);

        }

        finally {
        	// do for sure before leaving
        }
        return retval;
    }
    // $ANTLR end "declVar"


    public static class var_return extends ParserRuleReturnScope {
        CommonTree tree;
        public Object getTree() { return tree; }
    };


    // $ANTLR start "var"
    // src/epigraph.g:179:1: var : identifier ^ ( ASSIGN ! value )? ;
    public final epigraphParser.var_return var() throws RecognitionException {
        epigraphParser.var_return retval = new epigraphParser.var_return();
        retval.start = input.LT(1);


        CommonTree root_0 = null;

        Token ASSIGN98=null;
        epigraphParser.identifier_return identifier97 =null;

        epigraphParser.value_return value99 =null;


        CommonTree ASSIGN98_tree=null;

        try {
            // src/epigraph.g:179:4: ( identifier ^ ( ASSIGN ! value )? )
            // src/epigraph.g:180:3: identifier ^ ( ASSIGN ! value )?
            {
            root_0 = (CommonTree)adaptor.nil();


            pushFollow(FOLLOW_identifier_in_var803);
            identifier97=identifier();

            state._fsp--;

            root_0 = (CommonTree)adaptor.becomeRoot(identifier97.getTree(), root_0);

            // src/epigraph.g:180:15: ( ASSIGN ! value )?
            int alt22=2;
            int LA22_0 = input.LA(1);

            if ( (LA22_0==ASSIGN) ) {
                alt22=1;
            }
            switch (alt22) {
                case 1 :
                    // src/epigraph.g:180:16: ASSIGN ! value
                    {
                    ASSIGN98=(Token)match(input,ASSIGN,FOLLOW_ASSIGN_in_var807); 

                    pushFollow(FOLLOW_value_in_var810);
                    value99=value();

                    state._fsp--;

                    adaptor.addChild(root_0, value99.getTree());

                    }
                    break;

            }


            }

            retval.stop = input.LT(-1);


            retval.tree = (CommonTree)adaptor.rulePostProcessing(root_0);
            adaptor.setTokenBoundaries(retval.tree, retval.start, retval.stop);

        }
        catch (RecognitionException re) {
            reportError(re);
            recover(input,re);
    	retval.tree = (CommonTree)adaptor.errorNode(input, retval.start, input.LT(-1), re);

        }

        finally {
        	// do for sure before leaving
        }
        return retval;
    }
    // $ANTLR end "var"


    public static class type_token_return extends ParserRuleReturnScope {
        CommonTree tree;
        public Object getTree() { return tree; }
    };


    // $ANTLR start "type_token"
    // src/epigraph.g:183:1: type_token : ( INTEGER_NAME | DOUBLE_NAME | FLOAT_NAME | BYTE_NAME );
    public final epigraphParser.type_token_return type_token() throws RecognitionException {
        epigraphParser.type_token_return retval = new epigraphParser.type_token_return();
        retval.start = input.LT(1);


        CommonTree root_0 = null;

        Token set100=null;

        CommonTree set100_tree=null;

        try {
            // src/epigraph.g:183:13: ( INTEGER_NAME | DOUBLE_NAME | FLOAT_NAME | BYTE_NAME )
            // src/epigraph.g:
            {
            root_0 = (CommonTree)adaptor.nil();


            set100=(Token)input.LT(1);

            if ( input.LA(1)==BYTE_NAME||input.LA(1)==DOUBLE_NAME||input.LA(1)==FLOAT_NAME||input.LA(1)==INTEGER_NAME ) {
                input.consume();
                adaptor.addChild(root_0, 
                (CommonTree)adaptor.create(set100)
                );
                state.errorRecovery=false;
            }
            else {
                MismatchedSetException mse = new MismatchedSetException(null,input);
                throw mse;
            }


            }

            retval.stop = input.LT(-1);


            retval.tree = (CommonTree)adaptor.rulePostProcessing(root_0);
            adaptor.setTokenBoundaries(retval.tree, retval.start, retval.stop);

        }
        catch (RecognitionException re) {
            reportError(re);
            recover(input,re);
    	retval.tree = (CommonTree)adaptor.errorNode(input, retval.start, input.LT(-1), re);

        }

        finally {
        	// do for sure before leaving
        }
        return retval;
    }
    // $ANTLR end "type_token"


    public static class identifier_return extends ParserRuleReturnScope {
        CommonTree tree;
        public Object getTree() { return tree; }
    };


    // $ANTLR start "identifier"
    // src/epigraph.g:190:1: identifier : IDENTIFIER ;
    public final epigraphParser.identifier_return identifier() throws RecognitionException {
        epigraphParser.identifier_return retval = new epigraphParser.identifier_return();
        retval.start = input.LT(1);


        CommonTree root_0 = null;

        Token IDENTIFIER101=null;

        CommonTree IDENTIFIER101_tree=null;

        try {
            // src/epigraph.g:190:12: ( IDENTIFIER )
            // src/epigraph.g:190:14: IDENTIFIER
            {
            root_0 = (CommonTree)adaptor.nil();


            IDENTIFIER101=(Token)match(input,IDENTIFIER,FOLLOW_IDENTIFIER_in_identifier851); 
            IDENTIFIER101_tree = 
            (CommonTree)adaptor.create(IDENTIFIER101)
            ;
            adaptor.addChild(root_0, IDENTIFIER101_tree);


            }

            retval.stop = input.LT(-1);


            retval.tree = (CommonTree)adaptor.rulePostProcessing(root_0);
            adaptor.setTokenBoundaries(retval.tree, retval.start, retval.stop);

        }
        catch (RecognitionException re) {
            reportError(re);
            recover(input,re);
    	retval.tree = (CommonTree)adaptor.errorNode(input, retval.start, input.LT(-1), re);

        }

        finally {
        	// do for sure before leaving
        }
        return retval;
    }
    // $ANTLR end "identifier"


    public static class methodName_return extends ParserRuleReturnScope {
        CommonTree tree;
        public Object getTree() { return tree; }
    };


    // $ANTLR start "methodName"
    // src/epigraph.g:191:1: methodName : identifier ;
    public final epigraphParser.methodName_return methodName() throws RecognitionException {
        epigraphParser.methodName_return retval = new epigraphParser.methodName_return();
        retval.start = input.LT(1);


        CommonTree root_0 = null;

        epigraphParser.identifier_return identifier102 =null;



        try {
            // src/epigraph.g:191:12: ( identifier )
            // src/epigraph.g:191:14: identifier
            {
            root_0 = (CommonTree)adaptor.nil();


            pushFollow(FOLLOW_identifier_in_methodName858);
            identifier102=identifier();

            state._fsp--;

            adaptor.addChild(root_0, identifier102.getTree());

            }

            retval.stop = input.LT(-1);


            retval.tree = (CommonTree)adaptor.rulePostProcessing(root_0);
            adaptor.setTokenBoundaries(retval.tree, retval.start, retval.stop);

        }
        catch (RecognitionException re) {
            reportError(re);
            recover(input,re);
    	retval.tree = (CommonTree)adaptor.errorNode(input, retval.start, input.LT(-1), re);

        }

        finally {
        	// do for sure before leaving
        }
        return retval;
    }
    // $ANTLR end "methodName"

    // Delegated rules


 

    public static final BitSet FOLLOW_mainRule_in_prog74 = new BitSet(new long[]{0x0000000000000002L});
    public static final BitSet FOLLOW_module_in_mainRule85 = new BitSet(new long[]{0x0000000020404860L});
    public static final BitSet FOLLOW_declConst_in_mainRule90 = new BitSet(new long[]{0x0000000020404860L});
    public static final BitSet FOLLOW_declVar_in_mainRule94 = new BitSet(new long[]{0x0000000020404860L});
    public static final BitSet FOLLOW_main_block_in_mainRule100 = new BitSet(new long[]{0x0000000000000002L});
    public static final BitSet FOLLOW_block_in_main_block115 = new BitSet(new long[]{0x0000000000002000L});
    public static final BitSet FOLLOW_DOT_in_main_block117 = new BitSet(new long[]{0x0000000000000002L});
    public static final BitSet FOLLOW_BEGIN_in_block133 = new BitSet(new long[]{0x000000002C414840L});
    public static final BitSet FOLLOW_statement_in_block137 = new BitSet(new long[]{0x000000002C414840L});
    public static final BitSet FOLLOW_END_in_block141 = new BitSet(new long[]{0x0000000000000002L});
    public static final BitSet FOLLOW_identifier_in_method152 = new BitSet(new long[]{0x0000000080000000L});
    public static final BitSet FOLLOW_LPAREN_in_method155 = new BitSet(new long[]{0x0000100014200080L});
    public static final BitSet FOLLOW_argument_in_method159 = new BitSet(new long[]{0x0000008000000200L});
    public static final BitSet FOLLOW_identifier_in_method163 = new BitSet(new long[]{0x0000008000000200L});
    public static final BitSet FOLLOW_COMMA_in_method167 = new BitSet(new long[]{0x0000100014200080L});
    public static final BitSet FOLLOW_argument_in_method171 = new BitSet(new long[]{0x0000008000000200L});
    public static final BitSet FOLLOW_identifier_in_method175 = new BitSet(new long[]{0x0000008000000200L});
    public static final BitSet FOLLOW_RPAREN_in_method181 = new BitSet(new long[]{0x0000010000000000L});
    public static final BitSet FOLLOW_SEMI_in_method184 = new BitSet(new long[]{0x0000000000000002L});
    public static final BitSet FOLLOW_value_in_argument198 = new BitSet(new long[]{0x0000000000000002L});
    public static final BitSet FOLLOW_simple_statement_in_statement209 = new BitSet(new long[]{0x0000000000000002L});
    public static final BitSet FOLLOW_ifStatement_in_statement215 = new BitSet(new long[]{0x0000000000000002L});
    public static final BitSet FOLLOW_declConst_in_statement221 = new BitSet(new long[]{0x0000000000000002L});
    public static final BitSet FOLLOW_declVar_in_statement225 = new BitSet(new long[]{0x0000000000000002L});
    public static final BitSet FOLLOW_method_in_statement229 = new BitSet(new long[]{0x0000000000000002L});
    public static final BitSet FOLLOW_assignmentStatement_in_simple_statement239 = new BitSet(new long[]{0x0000010000000000L});
    public static final BitSet FOLLOW_SEMI_in_simple_statement241 = new BitSet(new long[]{0x0000000000000002L});
    public static final BitSet FOLLOW_variable_in_assignmentStatement252 = new BitSet(new long[]{0x0000000000000010L});
    public static final BitSet FOLLOW_ASSIGN_in_assignmentStatement254 = new BitSet(new long[]{0x0000004294000000L});
    public static final BitSet FOLLOW_expression_in_assignmentStatement257 = new BitSet(new long[]{0x0000000000000002L});
    public static final BitSet FOLLOW_identifier_in_variable267 = new BitSet(new long[]{0x0000000000000002L});
    public static final BitSet FOLLOW_simpleExpression_in_expression284 = new BitSet(new long[]{0x0000001141820002L});
    public static final BitSet FOLLOW_EQUAL_in_expression293 = new BitSet(new long[]{0x0000004294000000L});
    public static final BitSet FOLLOW_NOT_EQUAL_in_expression298 = new BitSet(new long[]{0x0000004294000000L});
    public static final BitSet FOLLOW_LT_in_expression303 = new BitSet(new long[]{0x0000004294000000L});
    public static final BitSet FOLLOW_LE_in_expression308 = new BitSet(new long[]{0x0000004294000000L});
    public static final BitSet FOLLOW_GE_in_expression313 = new BitSet(new long[]{0x0000004294000000L});
    public static final BitSet FOLLOW_GT_in_expression318 = new BitSet(new long[]{0x0000004294000000L});
    public static final BitSet FOLLOW_simpleExpression_in_expression323 = new BitSet(new long[]{0x0000001141820002L});
    public static final BitSet FOLLOW_term_in_simpleExpression347 = new BitSet(new long[]{0x0000004200000002L});
    public static final BitSet FOLLOW_PLUS_in_simpleExpression352 = new BitSet(new long[]{0x0000004294000000L});
    public static final BitSet FOLLOW_MINUS_in_simpleExpression357 = new BitSet(new long[]{0x0000004294000000L});
    public static final BitSet FOLLOW_term_in_simpleExpression362 = new BitSet(new long[]{0x0000004200000002L});
    public static final BitSet FOLLOW_signedFactor_in_term380 = new BitSet(new long[]{0x0000060400000002L});
    public static final BitSet FOLLOW_STAR_in_term385 = new BitSet(new long[]{0x0000004294000000L});
    public static final BitSet FOLLOW_SLASH_in_term390 = new BitSet(new long[]{0x0000004294000000L});
    public static final BitSet FOLLOW_MOD_in_term396 = new BitSet(new long[]{0x0000004294000000L});
    public static final BitSet FOLLOW_signedFactor_in_term401 = new BitSet(new long[]{0x0000060400000002L});
    public static final BitSet FOLLOW_PLUS_in_signedFactor422 = new BitSet(new long[]{0x0000000094000000L});
    public static final BitSet FOLLOW_MINUS_in_signedFactor425 = new BitSet(new long[]{0x0000000094000000L});
    public static final BitSet FOLLOW_factor_in_signedFactor430 = new BitSet(new long[]{0x0000000000000002L});
    public static final BitSet FOLLOW_variable_in_factor447 = new BitSet(new long[]{0x0000000000000002L});
    public static final BitSet FOLLOW_LPAREN_in_factor455 = new BitSet(new long[]{0x0000004294000000L});
    public static final BitSet FOLLOW_expression_in_factor458 = new BitSet(new long[]{0x0000008000000000L});
    public static final BitSet FOLLOW_RPAREN_in_factor460 = new BitSet(new long[]{0x0000000000000002L});
    public static final BitSet FOLLOW_INT_in_factor469 = new BitSet(new long[]{0x0000000000000002L});
    public static final BitSet FOLLOW_IF_in_ifStatement497 = new BitSet(new long[]{0x0000000080000000L});
    public static final BitSet FOLLOW_expr_in_ifStatement499 = new BitSet(new long[]{0x000000002C414840L});
    public static final BitSet FOLLOW_statement_in_ifStatement506 = new BitSet(new long[]{0x000000002C414840L});
    public static final BitSet FOLLOW_END_in_ifStatement514 = new BitSet(new long[]{0x0000010000000000L});
    public static final BitSet FOLLOW_SEMI_in_ifStatement516 = new BitSet(new long[]{0x0000000000008002L});
    public static final BitSet FOLLOW_elseStatement_in_ifStatement530 = new BitSet(new long[]{0x0000000000000002L});
    public static final BitSet FOLLOW_simple_statement_in_noIfStatement578 = new BitSet(new long[]{0x0000000000000002L});
    public static final BitSet FOLLOW_declConst_in_noIfStatement584 = new BitSet(new long[]{0x0000000000000002L});
    public static final BitSet FOLLOW_declVar_in_noIfStatement588 = new BitSet(new long[]{0x0000000000000002L});
    public static final BitSet FOLLOW_method_in_noIfStatement592 = new BitSet(new long[]{0x0000000000000002L});
    public static final BitSet FOLLOW_ELSE_in_elseStatement604 = new BitSet(new long[]{0x000000002C414840L});
    public static final BitSet FOLLOW_ifStatement_in_elseStatement608 = new BitSet(new long[]{0x0000000000000002L});
    public static final BitSet FOLLOW_noIfStatement_in_elseStatement615 = new BitSet(new long[]{0x0000000024414840L});
    public static final BitSet FOLLOW_END_in_elseStatement619 = new BitSet(new long[]{0x0000010000000000L});
    public static final BitSet FOLLOW_SEMI_in_elseStatement622 = new BitSet(new long[]{0x0000000000000002L});
    public static final BitSet FOLLOW_LPAREN_in_expr637 = new BitSet(new long[]{0x0000004294000000L});
    public static final BitSet FOLLOW_expression_in_expr639 = new BitSet(new long[]{0x0000008000000000L});
    public static final BitSet FOLLOW_RPAREN_in_expr641 = new BitSet(new long[]{0x0000000000000002L});
    public static final BitSet FOLLOW_MODULE_in_module665 = new BitSet(new long[]{0x0000000004000000L});
    public static final BitSet FOLLOW_identifier_in_module668 = new BitSet(new long[]{0x0000010000000000L});
    public static final BitSet FOLLOW_SEMI_in_module670 = new BitSet(new long[]{0x0000000000000002L});
    public static final BitSet FOLLOW_STRING_in_string683 = new BitSet(new long[]{0x0000000000000002L});
    public static final BitSet FOLLOW_CONST_in_declConst695 = new BitSet(new long[]{0x0000000020404040L});
    public static final BitSet FOLLOW_type_token_in_declConst697 = new BitSet(new long[]{0x0000000000000100L});
    public static final BitSet FOLLOW_COLON_in_declConst699 = new BitSet(new long[]{0x0000000004000000L});
    public static final BitSet FOLLOW_identifier_in_declConst701 = new BitSet(new long[]{0x0000000000000010L});
    public static final BitSet FOLLOW_ASSIGN_in_declConst703 = new BitSet(new long[]{0x0000100010200080L});
    public static final BitSet FOLLOW_value_in_declConst705 = new BitSet(new long[]{0x0000010000000200L});
    public static final BitSet FOLLOW_COMMA_in_declConst708 = new BitSet(new long[]{0x0000000004000000L});
    public static final BitSet FOLLOW_identifier_in_declConst710 = new BitSet(new long[]{0x0000000000000010L});
    public static final BitSet FOLLOW_ASSIGN_in_declConst712 = new BitSet(new long[]{0x0000100010200080L});
    public static final BitSet FOLLOW_value_in_declConst714 = new BitSet(new long[]{0x0000010000000200L});
    public static final BitSet FOLLOW_SEMI_in_declConst720 = new BitSet(new long[]{0x0000000000000002L});
    public static final BitSet FOLLOW_type_token_in_declVar776 = new BitSet(new long[]{0x0000000000000100L});
    public static final BitSet FOLLOW_COLON_in_declVar779 = new BitSet(new long[]{0x0000000004000000L});
    public static final BitSet FOLLOW_var_in_declVar782 = new BitSet(new long[]{0x0000010000000200L});
    public static final BitSet FOLLOW_COMMA_in_declVar785 = new BitSet(new long[]{0x0000000004000000L});
    public static final BitSet FOLLOW_var_in_declVar788 = new BitSet(new long[]{0x0000010000000200L});
    public static final BitSet FOLLOW_SEMI_in_declVar792 = new BitSet(new long[]{0x0000000000000002L});
    public static final BitSet FOLLOW_identifier_in_var803 = new BitSet(new long[]{0x0000000000000012L});
    public static final BitSet FOLLOW_ASSIGN_in_var807 = new BitSet(new long[]{0x0000100010200080L});
    public static final BitSet FOLLOW_value_in_var810 = new BitSet(new long[]{0x0000000000000002L});
    public static final BitSet FOLLOW_IDENTIFIER_in_identifier851 = new BitSet(new long[]{0x0000000000000002L});
    public static final BitSet FOLLOW_identifier_in_methodName858 = new BitSet(new long[]{0x0000000000000002L});

}